using System;
using System.IO;
using System.Text;
using System.Windows;
using Qplus.beans;
using System.Collections.Generic;

namespace Qplus.Commands
{

    /**
     * 
     *
     */
    public class GetUserListCommand : AbsHeaderHttpCommand , HttpInputStreamProcessor{

	    const String COMMAND = "GetUserList";
	
	    int type;
	    /**
	     * @param command
	     * @param uid
	     * @param UKEY
	     */
	    public GetUserListCommand(String uid, String UKEY)
            : base(COMMAND, uid, UKEY)
        {
		    
	    }
	
	    /**
	     * @param command
	     * @param uid
	     * @param UKEY
	     */
	    public GetUserListCommand(long uid, byte[] UKEY)
            : base(COMMAND, Convert.ToString(uid), Encoding.UTF8.GetString(UKEY, 0, UKEY.Length))
        {
		    
	    }
	
	    /**
	     * 获取类型(1 推荐用户 2 在线用户)
	     * @param type
	     */
	    public void set(int type){
		    setType(type);
		    this.type = type;
	    }
	
	    private void setType(int type){
		    addParams("Type", type);
	    }

	    
	    public override Boolean processInputStream(Stream responseStream) {
		    //TODO
            return true;
	    }

	    
	    public override void onSuccess(int code) {
	    }


        public override void onFailed(int code)
        {
	    }
	
	    /**
	     * 
	     * @param type (1 推荐用户 2 在线用户)
	     * @param list
	     */
	    public void onGetUserList(int type, List<UserInfo> list){
	    }
	
	    public HttpTask execute(String url) {
		    return base.execute(url, this);
	    }
    }
}
